/*
 * PANEButtonElement.h
 *
 *  Created on: Apr 27, 2009
 *      Author: wrice
 */

#ifndef PANEBUTTONELEMENT_H_
#define PANEBUTTONELEMENT_H_
#include "PANEImp.h"
namespace PANEImp {

class PANEButtonElement : public PANEElement, IMPLEMENTS( VisualButtonForPANE ) {
protected:
	friend class PANEDocument;
	PANEButtonElement( PANEDocument * ownerDocument );

public:
	static string TagName;
	static string AttrNameNormalImage;
	static string AttrNameMouseOverImage;
	static string AttrNameMouseDownImage;
	static string AttrNameDisabledImage;
	static string AttrNameDisabled;
	static string AttrValueDisabledTrue;
	static string AttrValueDisabledFalse;

public: // from PANEElement
	virtual unsigned long getWidth();
	virtual unsigned long getHeight();

public: // new for button
	virtual void setNormalImage( string url );
	virtual void setMouseOverImage( string url );
	virtual void setMouseDownImage( string url );
	virtual void setDisabledImage( string url );

	virtual string getNormalImage();
	virtual string getMouseOverImage();
	virtual string getMouseDownImage();
	virtual string getDisabledImage();

	virtual void setDisabled( bool );
	virtual bool getDisabled();

public: // from VisualSegmentForPANE
	virtual unsigned long getActualWidth( unsigned long availableWidth );
	virtual unsigned long getActualHeight( unsigned long availableWidth );

public: // from VisualButonForPANE
	virtual DOMString getNormalImageURL();
	virtual DOMString getMouseOverImageURL();
	virtual DOMString getMouseDownImageURL();
	virtual DOMString getDisabledImageURL();
	virtual unsigned short getLoadedImages();

	virtual unsigned short getButtonState();
	virtual void setButtonState( unsigned short buttonState );

	virtual bool getIsDisabled();
	virtual bool getIsLoaded();

public: // from RenderableWithOpenCV
	virtual void render( IplImage * img );

private:
	struct Imp;
	unsigned short buttonState_;
	IplImage * cvImgs_[4];
	string loadedFiles_[4];

	void loadImageFiles();

public:	virtual ~PANEButtonElement();
};

}

#endif /* PANEBUTTONELEMENT_H_ */
